<?php

require_once 'Base.php';



class CategoryModel extends Base {
	
	public function getList($where = '', $limit = ''){
		
		//$where['id = ?'] = 1;
		if($where) $this->where($where);
		
		//$limit = "0,1";
		if($limit) $this->limit($limit);
		
		
		return $this->select();
	}
	
	public function get_goods_category($where ='', $limit = ''){
		
// 		$UserController=new UserNamespace\UserController();
// 		$UserController->logincheckAction();
		$this->_db = $this->getAdapter();
    	$select = $this->_db->select();
    	$select->from('shop_goods_category');
    	
	     foreach ($where as $key => $val) {
            if (is_int($key)) {
               
               $select->where($val);
            } else {
              
                $select->where($key, $val);
            }
	     }   
    	//if($pagesize) $select->limit($pagesize,$page*$pagesize); 
    	$category_list=$this->_db->fetchAll($select);
    
    	return $this->_db->fetchAll($select);
	
	
		
	}
}
